<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="js/jquery-3.6.0.js"></script>
    <style>
        tr:nth-of-type(odd){
            background-color: dimgray;
        }
    </style>
</head>
<body>
    <h1>个人简历信息列表</h1>
    <p>
        性别:<input type="radio" value="男">男
            <input type="radio" value="女">女
            <input type="radio" value="全部">全部
            <button onclick="select()">查询</button>
            <input type="button" onclick=location.href="ResumeAdd.jsp" value="新增个人简历信息">
    </p>
    <table border="1px">
        <tr>
            <th>姓名</th>
            <th>性别</th>
            <th>籍贯地址</th>
            <th>出生时间</th>
            <th>联系电话</th>
            <th>毕业学校</th>
            <th>学历状态</th>
            <th>操作</th>
        </tr>
        <c:forEach items="${list}" var="list">
            <tr>
                <th>#{list.userName}</th>
                <th>#{list.sex}</th>
                <th>#{list.birth}</th>
                <th>#{list.address}</th>
                <th>#{list.telephone}</th>
                <th>#{list.school}</th>
                <th>#{list.status==0?"保密":"公开"}</th>
                <th><a href="javascript:void(0)" onclick="del(${list.id})">删除</a></th>
            </tr>
        </c:forEach>
    </table>
</body>
<script>
    function del(id){
        if (confirm("确定要删除吗?")){
            $.get("ResumeDelete","id="+id,function (data){
                if (data == true){
                    alert("删除成功!");
                    location.reload();
                }else{
                    alert("删除失败!");
                    location.reload();
                }
            })
        }
    }
</script>
</html>
